
#ifndef _UI_LCD_H
#define _UI_LCD_H

#ifdef __cplusplus
extern "C" {
#endif

#define UI_TIMER_LOCK_MAX     1000

#define UI_TIMER_DATETIME_MAX     100

#define UI_TIMER_COMTIME_MAX     7




typedef enum _ui_keyval_
{
 UI_KEYVAL_NON=0,
 UI_KEYVAL_READ_SHORT,
 UI_KEYVAL_WRITE_SHORT,
 UI_KEYVAL_RIGHT_SHORT,
 UI_KEYVAL_LEFT_SHORT,
 UI_KEYVAL_UP_SHORT,
 UI_KEYVAL_DOWN_SHORT,
 UI_KEYVAL_OK_SHORT,
 UI_KEYVAL_POWER_SHORT,
 UI_KEYVAL_0_SHORT,
 UI_KEYVAL_1_SHORT,
 UI_KEYVAL_2_SHORT,
 UI_KEYVAL_3_SHORT,
 UI_KEYVAL_4_SHORT,
 UI_KEYVAL_5_SHORT,
 UI_KEYVAL_6_SHORT,
 UI_KEYVAL_7_SHORT,
 UI_KEYVAL_8_SHORT,
 UI_KEYVAL_9_SHORT,
 UI_KEYVAL_READ_LONG,
 UI_KEYVAL_WRITE_LONG,
 UI_KEYVAL_RIGHT_LONG,
 UI_KEYVAL_LEFT_LONG,
 UI_KEYVAL_UP_LONG,
 UI_KEYVAL_DOWN_LONG,
 UI_KEYVAL_OK_LONG,
 UI_KEYVAL_POWER_LONG,
 UI_KEYVAL_0_LONG,
 UI_KEYVAL_1_LONG,
 UI_KEYVAL_2_LONG,
 UI_KEYVAL_3_LONG,
 UI_KEYVAL_4_LONG,
 UI_KEYVAL_5_LONG,
 UI_KEYVAL_6_LONG,
 UI_KEYVAL_7_LONG,
 UI_KEYVAL_8_LONG,
 UI_KEYVAL_9_LONG,
 UI_KEYVAL_INIT_UI,
 UI_KEYVAL_TICK_UI,
 UI_KEYVAL_POWEROFF_UI,
 UI_KEYVAL_SHORT_UI,
 UI_KEYVAL_SHORT_EM_UI,
}ui_keyval_e;

typedef enum _ui_page_idx
{
    UI_PAGE_IDX_INIT = 0,
    UI_PAGE_IDX_CODER,
    UI_PAGE_IDX_INC_CODER,
    UI_PAGE_IDX_MODELSET,
    UI_PAGE_IDX_SOUNDERSET,
    UI_PAGE_IDX_ELECTRICALDH,
    UI_PAGE_IDX_MULTIFUN,
    UI_PAGE_IDX_TESTMODE,
    UI_PAGE_IDX_MAX,
} ui_page_idx_e;






typedef struct
{
  ui_page_idx_e curpageidx; // 当前页面索引
  Ring_t ring;
  uint8_t settinginfoidx;           // 菜单里面的项目
  int cursoridx;  // 光标位置
  uint8_t batterlevel;
  TickType_t lcdlighttimer;//背光控制定时器
  TickType_t lcdreflashtimer;//界面更新定时器
  TickType_t powerofftimer;//关机控制定时器
  TickType_t testmodecnt;  //产测模式有效计数
  uint8_t autopoweroff;//是否自动关机标志
  uint8_t poweronflag;//开机标志
  
} ui_t;








extern ui_t uitcb;

void ui_lcd_init(ui_t*ui);
void ui_lcd_postkeyval(ui_t*ui,ui_keyval_e keyval);
ui_keyval_e ui_lcd_getkeyval(ui_t *ui);
void ui_lcd_setuipage(ui_page_idx_e page);
bool ui_lcd_isrealkeyval(ui_keyval_e keyval);
const char *ui_lcd_languagetr(ui_t *ui, int index);
void ui_lcd_setrtc(ui_t *ui, uint8_t hour, uint8_t minute);
void ui_lcd_page_idx_settinginfo_addset(ui_t *ui, ui_keyval_e keyval);
void ui_lcd_page_idx_setting(ui_t *ui, ui_keyval_e keyval);
void  ui_lcd_page_idx_password(ui_t *ui,ui_keyval_e keyval);
void ui_lcd_page_idx_home_selftest(ui_t *ui, ui_keyval_e keyval);
void ui_lcd_page_idx_home(ui_t *ui,ui_keyval_e keyval);
void ui_lcd_basetime(void);
void ui_lcd_process(ui_t *ui);
#ifdef __cplusplus
}
#endif

#endif /* __ZB32L03x_STARTERKIT_H */


